using MediatR;
using Microsoft.AspNetCore.Mvc;
using Ordering.Application.Commands;

namespace Ordering.API.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class OrdersController : ControllerBase
    {

        private readonly ILogger<OrdersController> _logger;

        public OrdersController(ILogger<OrdersController> logger)
        {
            _logger = logger;
        }
     
        [HttpPost("Start")]
        public async Task Create([FromServices] IMediator mediator, CreateOrderCommand command)
        {
            await mediator.Send(command);
        }

        [HttpPost("Payment")]
        public async Task Create([FromServices] IMediator mediator, PaymentOrderCommand command)
        {
            await mediator.Send(command);
        }
    }
}